package juc.mythread.create;

import java.util.AbstractMap;

/**
 * @ClassName testYield
 * @PackageName mythread.create
 * @projectName myThread
 * @Description 
 * @Author games
 * @Date 2025/8/25 下午2:21
 * @Version 1.0
 */
public class testYield {
    // C:\worksapce\softend\jdk-versions\jdk17-ins\lib\src.zip!\java.base\javautil\concurrent\ConcurrentHashMap.java
    // private final Node<K,V>[] initTable() {
    //    Node<K,V>[] tab; int sc;
    //    while ((tab = table) == null || tab.length == 0) {
    //        if ((sc = sizeCtl) < 0)
    //            Thread.yield(); // lost initialization race; just spin
    //        else if (U.compareAndSwapInt(this, SIZECTL, sc, -1)) {
    //            try {
    //                if ((tab = table) == null || tab.length == 0) {
    //                    int n = (sc > 0) ? sc : DEFAULT_CAPACITY;
    //                    Node<K,V>[] nt = (Node<K,V>[])new Node<?,?>[n];
    //                    table = tab = nt;
    //                    sc = n << 1; // use threshold of 2 * capacity
    //                }
    //            } finally {
    //                sizeCtl = sc;
    //            }
    //            break;
    //        }
    //    }
    //    return tab;
    //}
}
